import { Color } from "cc";
import { EItemType } from "../Item/Item";


//游戏配置相关
export enum EPath {
    AUDIO_SOUND = "audio/sound/",
    AUDIO_MUSIC = 'audio/music/',
    PREFAB = 'prefab/',
    PIC_SKILL = 'pic/skill/',
    PIC_EQUIPMENT = 'pic/equipment/',
    PIC_EQUIPMENT_ARMOR = 'pic/equipment/armor/',
    PIC_EQUIPMENT_BELT = 'pic/equipment/belt/',
    PIC_EQUIPMENT_BRACERS = 'pic/equipment/bracers/',
    PIC_EQUIPMENT_HELMET = 'pic/equipment/helmet/',
    PIC_EQUIPMENT_WEAPON = 'pic/equipment/weapon/',
    PIC_EQUIPMENT_LEGGING = 'pic/equipment/legging/',
    PIC_EQUIPMENT_PENDANT = 'pic/equipment/pendant/',
    PIC_EQUIPMENT_SHOES = 'pic/equipment/shoes/',
    PIC_ITEM = 'pic/item/',
    PIC_AVATAR = 'pic/avatar/',
    
}

export enum EPrefabName {
    ENERGY_BALL = 'EnergyBall',
    ARROW = 'Arrow',
    GHOST = 'Ghost',
    SPIDER = 'Spider',
    NUMBER_TEXT = 'NumberText',
    MONSTER_DEAD = 'MonsterDead',
}



export enum EGameSystem {
    Shop = 1,
    Wall = 2,
    General = 3,
    Forge = 4,
    Beacon = 5,
    Pet = 6,
    Treasure = 7,
    Martial = 8, // 如果有修炼
}

// // 游戏内容相关
// export enum EGameSystem {

//   // Footer 义士
//   HeroTraining = "HeroTraining", // 英雄修炼
//   // Footer 背包
//   Bag = "Bag",              // 背包
//   Shop = "Shop",          // 背包商店
//   Forge = "Forge",        // 背包锻造
//   // Footer 将军
//   General = "General",        // 将领
//   // Footer 军政
//   Martial = "Martial",      // 军政
//   Farming = "Farming",    // 农场
//   Fortify = "Fortify",    // 筑城
//   Beacon = "Beacon",    // 烽火台
//   Wall = "Wall",    // 城墙
//   Pet = "Pet",    // 宠物
//   Treasure = "Treasure",    // 宝藏


// }

export enum EMartialSystem {
  Farming = "Farming",    // 农场
  WoodRock = "WoodRock", //伐木采石
  Fortify = "Fortify",    // 筑城
  Search = "Search",    // 搜索
  Beacon = "Beacon",    // 烽火台
}

export enum EGameSubSystem {
  

}



export enum EBuff {
  // 对怪物
  Slow = "Slow", // 减速
  Stun = "Stun", // 眩晕
  Poison = "Poison", // 中毒
  Burn = "Burn", // 燃烧
  KnockBack = "KnockBack", // 击退
  Root = "Root", // 定身
  Freeze = "Freeze", // 冰冻
  AttackDown = "AttackDown",
  DefenceDown = "DefenceDown", // 防御下降
  Miss = "Miss", // 命中率下降50%
  Vulnerable = "Vulnerable", // 易伤，受到的伤害增加50%
  Weak = "Weak", // 虚弱，攻击力下降50%
  Silence = "Silence", // 沉默，无法使用武学
  Fear = "Fear", // 恐惧，随机移动
  Disarm = "Disarm", // 解除武装，无法使用武器攻击
  Blind = "Blind",
  Explosion = "Explosion",
  


  // 玩家
  CriticalChance = "CriticalChance", // 暴击率
  CriticalDamage = "CriticalDamage", // 暴击伤害
  AttackSpeed = "AttackSpeed", // 攻击速度
  Attack = "Attack", // 攻击力
  Shield = "Shield", // 盾
  CD = "CD" // 调息
}

export enum EBaseAttribute {
  Strength = "Strength", // 力量
  Agility = "Agility", // 身法
  Intelligence = "Intelligence", // 悟性
  InnerPower = "InnerPower", // 内力
  Vitality = "Vitality", // 体质
  // KeenEye, // 眼力

}

export enum EWuxing {
  Jin = "金",
  Mu = "木",
  Shui = "水",
  Huo = "火",
  Tu = "土",

}



export enum ESkillType {
  Forward = "Forward",
  InPlace = "InPlace",
  Myself = "Myself",
  Buff = "Buff",
  Debuff = "Debuff",
  BuffAll = "BuffAll",
  DebuffAll = "DebuffAll",
  Center = "Center",

}


export enum EWeather {

    Sunny = "晴空万里",
    Rainy = "倾盆大雨", 
    Foggy = "大雾弥漫", 
    Cloudy = "阴云密布", // 或 "阴云密布"
    Windy = "狂风大作", 
    //Stormy = "Stormy", // 暴风雨
    // Cloudy = "Cloudy", // 多云
    // Hail = "Hail", // 冰雹
    // Thunderstorm = "Thunderstorm", // 雷暴
    // Blizzard = "Blizzard", // 暴风雪
    // Sandstorm = "Sandstorm", // 沙暴
    // Duststorm = "Duststorm", // 砂尘暴
    // Tornado = "Tornado", // 龙卷风
    // Tsunami = "Tsunami", // 海啸
    // Volcano = "Volcano", // 火山爆发
    // Meteor = "Meteor", // 流星雨
    // Nuclear = "Nuclear", // 核爆

}


// 碰撞组
export enum EGroup {
    DEFAULT = 1 << 0,
    WALL = 1 << 1,
    PLAYER_SKILL = 1 << 2,
    ENEMY = 1 << 3,
}

export const PLAY_AREA = {
    minX: 0,
    maxX: 400,
    minY: 0,
    maxY: 800
};


export enum EGame {
    Battle = "Battle"
}

export enum EGameMode {
    Normal = "Normal",
    Endless = "Endless",
    Gold = "Gold",
    Pet = "Pet",
    Gem = "Gem",
    Boss = "Boss",
    Wood = "Wood",
}

// 扩展枚举的显示文本
export const GameModeDisplayText = {
    [EGameMode.Normal]: "襄阳烽烟",
    [EGameMode.Endless]: "血战到底",
    [EGameMode.Gold]: "辎重押运(铜钱模式)",
    [EGameMode.Pet]: "灵兽奇缘(宠物模式)",
    [EGameMode.Gem]: "玲珑夺宝(宝石模式)",
    [EGameMode.Wood]: "校场演武(木桩模式)",
    [EGameMode.Boss]: "万军取首(Boss挑战)"
};



export enum EScene {
  Start = "Start",
  Start_1 = "Start_1",
  //Choose = "Choose",
  Main = "Main",
  Battle = "Battle",
  FirstMain = "FirstMain",
  FirstBattle = "FirstBattle",
}




export enum ESkill {
  ShaolinSkill1 = "ShaolinSkill1",
  ShaolinSkill2 = "ShaolinSkill2",
  ShaolinSkill3 = "ShaolinSkill3",
  TangmenSkill1 = "TangmenSkill1",
  TangmenSkill2 = "TangmenSkill2",
  TangmenSkill3 = "TangmenSkill3",
  TangmenExplosion = "TangmenExplosion",
  EmeiSkill1 = "EmeiSkill1",
  EmeiSkill2 = "EmeiSkill2",
  EmeiSkill3 = "EmeiSkill3",
  GaibangSkill1 = "GaibangSkill1",
  GaibangSkill2 = "GaibangSkill2",
  GaibangSkill3 = "GaibangSkill3",
  GaibangExplosion1 = "GaibangExplosion1",
  WudangSkill1 = "WudangSkill1",
  WudangSkill2 = "WudangSkill2",
  WudangSkill3 = "WudangSkill3",
  WudangBo = "WudangBo",

  DragEnemy = "DragEnemy", // 拖拽敌人武学
  Wanjianqifa = "Wanjianqifa", // 万剑齐发 将军技能
  Arrow = "Arrow", // 箭



}

export enum EPetSkill {
    // 宠物技能
  PetSkill1 = "PetSkill1",
  PetSkill2 = "PetSkill2",
  PetSkill3 = "PetSkill3",
}



//export type EItemType = EEquipmentType | EMaterialtype  

export enum EPlayerType {
  //All = "All",
  Shaolin = "Shaolin",
  Tangmen = "Tangmen",
  Emei = "Emei",
  Gaibang = "Gaibang",
  Wudang = "Wudang",

}

export enum EPet {
  Pig = "Pig",
  
  
}

export enum ENPC {
  Cangku = "Cangku",
  Shop = "Shop",
  Forge = "Forge"
}


export enum EMartialType {
  Farming = "Farming",    // 农场
  Fortify = "Fortify",    // 工事
  Beacon = "Beacon",    // 烽火台
}





export enum EFsmParamType {
    Number = "Number",
    Trigger = "Trigger",
}
  
// 
export enum EParamsName {
  Idle = "Idle",
  Attack = "Attack",
  Run = "Run",
  Die = "Die",
  IdleFront = "IdleFront",
}

export enum EState {
  Idle = "Idle",
  Attack = "Attack",
  Run = "Run",
  Die = "Die",
  IdleFront = "IdleFront",
}

export enum EEvent {
  //Player相关
  PassiveSkillUpdate = "PassiveSkillUpdate",
  PlayerSelected = "PlayerSelected",
  PlayerSelectedChange = "PlayerSelectedChange",
  PlayerDataChange = "PlayerDataChange", // 请playerdata重新算一遍
  PlayerDataUpdated = "PlayerDataUpdated", // playerdata算完了，通知各组件更新展示
  PlayerLevelUp = "PlayerLevelUp",


  PlayerBuff = "PlayerBuff",
  PlayerUltimateReady = "PlayerUltimateReady",

  EnemyBuffChanged = "EnemyBuffChanged",


  WeaponShoot = "WeaponShoot",
  BulletBorn = "BulletBorn",
  ExplosionBorn = "ExplosionBorn",
  RoomJoin = "RoomJoin",
  GameStart = "GameStart",
  GameEnd = "GameEnd",
  ClientSync = "ClientSync",

  EquipmentChanged = "EquipmentChanged",

  APChange = "APChange",
  HPChange = "HPChange",
  SkillUpgrade = "SkillUpgrade",

  
  EnemyDie = "EnemyDie",
  DamageDeal = "DamageDeal",
  DamageUpdateHeader = "DamageUpdateHeader",
  MoneyUpdateHeader = "MoneyUpdateHeader",

  //军政
  FarmingUpdate = "FarmingUpdate",
  FortifyUpdate = "FortifyUpdate",
  BeaconUpdate = "BeaconUpdate",

  //数据
  ResourceChanged = "ResourceChanged",

  //商店购买东西
  ShopBuy = "ShopBuy",

  //宠物
  PetUpdate = "PetUpdate",

  //资源
  MoneyChange = "MoneyChange",
  WoodChange = "WoodChange",

  //功能
  OpenForgeView = "OpenForgeView",
  ItemSold = "ItemSold",



}



export enum EText {
  Text = "Text",

}

export enum ETips {
  Tips = "Tips",
  Label = "Label",
  Label_Center = "Label_Center",
  Board_ItemGot = "Board_ItemGot",
}



// 实体类型
export enum EEntityCategory {
  Enemy = "Enemy",
  Player = "Player",
  Skill = "Skill",
  Text = "Text",
  Tips = "Tips",
}


export enum EEnemyType {
  Humen = "Humen",
  Animal = "Animal",
  Ghost = "Ghost",
  Insect = "Insect",
  Boss = "Boss",
  Machine = "Machine",
  
}

// 分层定义子类型
export enum EEnemy {

  // Goblin = "Goblin",
  // Dragon = "Dragon",
  WoodenEnemy = "WoodenEnemy",
  Enemy_GoldCarriage = "Enemy_GoldCarriage",
  Enemy1 = "Enemy1",
  Enemy2 = "Enemy2",
  Enemy3 = "Enemy3",
  Enemy4 = "Enemy4",
  Enemy5 = "Enemy5",
  Enemy6 = "Enemy6",
  Enemy7 = "Enemy7",
  Enemy8 = "Enemy8",
  Enemy9 = "Enemy9",
  Enemy10 = "Enemy10",
  Enemy11 = "Enemy11",
  Enemy12 = "Enemy12",
  Enemy13 = "Enemy13",
  Enemy14 = "Enemy14",
  Enemy15 = "Enemy15",
  Enemy16 = "Enemy16",
  Enemy17 = "Enemy17",
  Enemy18 = "Enemy18",
  Enemy19 = "Enemy19",
  Enemy20 = "Enemy20",
  Enemy21 = "Enemy21",
  Enemy22 = "Enemy22",
  Enemy23 = "Enemy23",
  Enemy24 = "Enemy24",
  Enemy25 = "Enemy25",
  Enemy26 = "Enemy26",
  Enemy27 = "Enemy27",
  Enemy28 = "Enemy28",
  Enemy29 = "Enemy29",
  Enemy30 = "Enemy30",
  


  Boss1 = "Boss1",Boss2 = "Boss2",Boss3 = "Boss3",Boss4 = "Boss4",Boss5 = "Boss5",Boss6 = "Boss6",Boss7 = "Boss7",Boss8 = "Boss8",Boss9 = "Boss9",Boss10 = "Boss10",

  
}


export enum EColor {
  Jin = "DDB32C",
  Mu = "3BA343",
  Shui = "3B8AA3",
  Huo = "A3433B",
  Tu = "B9B7A3",
  "金" = "DDB32C",
  "木" = "3BA343",
  "水" = "3B8AA3",
  "火" = "A3433B",
  "土" = "B9B7A3",
  Burn = "E66123", // 灼烧
  Slow = "4B8BFF", // 蓝色
  Stun = "727272", // 红色
  freeze = "54b4de", // 冰冻
  Yellow = "Yellow",
  Purple = "9E0091", 
  Orange = "D87547C8",
  White = "White",
  Black = "Black",
  Orange_Light = "C27D47",

  BossHalo = "FFE000",
  EliteHalo = "AD00FF",

  WuxingActive = "5FC0FF",
  WuxingDeactive = "3B7BA5",


}



// 动画播放配置一次还是循环
export enum EAnimationPlayMode {
  Normal = 1,
  Loop = 2, // 一直循环
  LoopToEnd = 3, // 循环到结束

}

export enum EMaterialtype {
  // 材料类型
  Gem,
  Coin
}


// 动态生成 EntityType（无需手动维护）
export type EntityType =
  | EEnemy
  | EPlayerType
  | ESkill
  | EItemType
  | EText
  | ETips
  | EBuff
  | EPet
  | `${EPlayerType}${ESkill}`; // 武学类型自动生成（如 "ShaolinSkill1"）

// 使用示例
const enemyType: EntityType = EEnemy.Enemy1;
const playerType: EntityType = EPlayerType.Shaolin;
const skillType: EntityType = ESkill.ShaolinSkill1; // 自动推断为 EntityType



// 将军武学
export enum EGeneralSkill {
  Fengtiaoyushun = "Fengtiaoyushun", // 风调雨顺
  Zhongzhichengcheng = "Zhongzhichengcheng", // 忠志诚诚
  Manzaiergui = "Manzaiergui", // 满载而归
  Fuzaoshengfeng = "Fuzaoshengfeng", // 斧凿生风

  Wanjianqifa = "Wanjianqifa", // 万箭齐发
  Shiwanhuoji = "Shiwanhuoji", // 十万火急
  Jinjijiagu = "Jinjijiagu", // 紧急加固
  Fengyunbianse = "Fengyunbianse" // 风云变色

}

// 将军等级对应的官职名
export enum EGeneralLevel {
  Level1 = "1",
  Level2 = "2",
  Level3 = "3",
  Level4 = "4",
  Level5 = "5",
  Level6 = "6",
  Level7 = "7",
  Level8 = "8",
  Level9 = "9"
}

// 将军等级对应的官职名映射
export const GeneralLevelToTitle: Record<EGeneralLevel | string, string> = {
  [EGeneralLevel.Level1]: "准备差使",
  [EGeneralLevel.Level2]: "副都头",
  [EGeneralLevel.Level3]: "都头",
  [EGeneralLevel.Level4]: "副指挥使",
  [EGeneralLevel.Level5]: "指挥使",
  [EGeneralLevel.Level6]: "都监",
  [EGeneralLevel.Level7]: "钤辖",
  [EGeneralLevel.Level8]: "路分都监",
  [EGeneralLevel.Level9]: "马步军都总管",

};

// 主视图
export enum EView {
  PlayerView = "PlayerView",
  ArsenalView = "ArsenalView",
  BattleView = "BattleView",
  GeneralView = "GeneralView",
  MartialView = "MartialView",

}

// 子视图
export enum ESubView {

  Shop = "Shop",
  Bag = "Bag",
  Forge = "Forge",
  EquipmentSwitch = "EquipmentSwitch",

}